Optimal. Leaf size=139 \[ \frac {x}{a^2}+\frac {\cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {2 \cot ^7(c+d x)}{7 a^2 d}-\frac {2 \csc (c+d x)}{a^2 d}+\frac {2 \csc ^3(c+d x)}{a^2 d}-\frac {6 \csc ^5(c+d x)}{5 a^2 d}+\frac {2 \csc ^7(c+d x)}{7 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 139, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3973, 3971,
3554, 8, 2686, 200, 2687, 30} \begin {gather*} -\frac {2 \cot ^7(c+d x)}{7 a^2 d}+\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot (c+d x)}{a^2 d}+\frac {2 \csc ^7(c+d x)}{7 a^2 d}-\frac {6 \csc ^5(c+d x)}{5 a^2 d}+\frac {2 \csc ^3(c+d x)}{a^2 d}-\frac {2 \csc (c+d x)}{a^2 d}+\frac {x}{a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 200
Rule 2686
Rule 2687
Rule 3554
Rule 3971
Rule 3973
Rubi steps
\begin {align*} \int \frac {\cot ^4(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\frac {\int \cot ^8(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4}\\ &=\frac {\int \left (a^2 \cot ^8(c+d x)-2 a^2 \cot ^7(c+d x) \csc (c+d x)+a^2 \cot ^6(c+d x) \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac {\int \cot ^8(c+d x) \, dx}{a^2}+\frac {\int \cot ^6(c+d x) \csc ^2(c+d x) \, dx}{a^2}-\frac {2 \int \cot ^7(c+d x) \csc (c+d x) \, dx}{a^2}\\ &=-\frac {\cot ^7(c+d x)}{7 a^2 d}-\frac {\int \cot ^6(c+d x) \, dx}{a^2}+\frac {\text {Subst}\left (\int x^6 \, dx,x,-\cot (c+d x)\right )}{a^2 d}+\frac {2 \text {Subst}\left (\int \left (-1+x^2\right )^3 \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {2 \cot ^7(c+d x)}{7 a^2 d}+\frac {\int \cot ^4(c+d x) \, dx}{a^2}+\frac {2 \text {Subst}\left (\int \left (-1+3 x^2-3 x^4+x^6\right ) \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {2 \cot ^7(c+d x)}{7 a^2 d}-\frac {2 \csc (c+d x)}{a^2 d}+\frac {2 \csc ^3(c+d x)}{a^2 d}-\frac {6 \csc ^5(c+d x)}{5 a^2 d}+\frac {2 \csc ^7(c+d x)}{7 a^2 d}-\frac {\int \cot ^2(c+d x) \, dx}{a^2}\\ &=\frac {\cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {2 \cot ^7(c+d x)}{7 a^2 d}-\frac {2 \csc (c+d x)}{a^2 d}+\frac {2 \csc ^3(c+d x)}{a^2 d}-\frac {6 \csc ^5(c+d x)}{5 a^2 d}+\frac {2 \csc ^7(c+d x)}{7 a^2 d}+\frac {\int 1 \, dx}{a^2}\\ &=\frac {x}{a^2}+\frac {\cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {2 \cot ^7(c+d x)}{7 a^2 d}-\frac {2 \csc (c+d x)}{a^2 d}+\frac {2 \csc ^3(c+d x)}{a^2 d}-\frac {6 \csc ^5(c+d x)}{5 a^2 d}+\frac {2 \csc ^7(c+d x)}{7 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(314\) vs. \(2(139)=278\).
time = 1.02, size = 314, normalized size = 2.26 \begin {gather*} \frac {\csc \left (\frac {c}{2}\right ) \csc ^3(c+d x) \sec \left (\frac {c}{2}\right ) \sec ^2(c+d x) (5880 d x \cos (d x)-5880 d x \cos (2 c+d x)+3360 d x \cos (c+2 d x)-3360 d x \cos (3 c+2 d x)-1260 d x \cos (2 c+3 d x)+1260 d x \cos (4 c+3 d x)-1680 d x \cos (3 c+4 d x)+1680 d x \cos (5 c+4 d x)-420 d x \cos (4 c+5 d x)+420 d x \cos (6 c+5 d x)-4032 \sin (c)-9632 \sin (d x)+16002 \sin (c+d x)+9144 \sin (2 (c+d x))-3429 \sin (3 (c+d x))-4572 \sin (4 (c+d x))-1143 \sin (5 (c+d x))-11760 \sin (2 c+d x)-8864 \sin (c+2 d x)-3360 \sin (3 c+2 d x)+2064 \sin (2 c+3 d x)+2520 \sin (4 c+3 d x)+4432 \sin (3 c+4 d x)+1680 \sin (5 c+4 d x)+1528 \sin (4 c+5 d x))}{26880 a^2 d (1+\sec (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 98, normalized size = 0.71
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{7}-\frac {7 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {22 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-42 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+64 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {7}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{32 d \,a^{2}}\) | \(98\) |
default | \(\frac {\frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{7}-\frac {7 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {22 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-42 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+64 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {7}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{32 d \,a^{2}}\) | \(98\) |
risch | \(\frac {x}{a^{2}}-\frac {2 i \left (210 \,{\mathrm e}^{9 i \left (d x +c \right )}+315 \,{\mathrm e}^{8 i \left (d x +c \right )}-420 \,{\mathrm e}^{7 i \left (d x +c \right )}-1470 \,{\mathrm e}^{6 i \left (d x +c \right )}-504 \,{\mathrm e}^{5 i \left (d x +c \right )}+1204 \,{\mathrm e}^{4 i \left (d x +c \right )}+1108 \,{\mathrm e}^{3 i \left (d x +c \right )}-258 \,{\mathrm e}^{2 i \left (d x +c \right )}-554 \,{\mathrm e}^{i \left (d x +c \right )}-191\right )}{105 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{7} \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )^{3}}\) | \(143\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 157, normalized size = 1.13 \begin {gather*} -\frac {\frac {\frac {4410 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {770 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {147 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {15 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a^{2}} - \frac {6720 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac {35 \, {\left (\frac {21 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a^{2} \sin \left (d x + c\right )^{3}}}{3360 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.05, size = 154, normalized size = 1.11 \begin {gather*} \frac {191 \, \cos \left (d x + c\right )^{5} + 172 \, \cos \left (d x + c\right )^{4} - 253 \, \cos \left (d x + c\right )^{3} - 258 \, \cos \left (d x + c\right )^{2} + 105 \, {\left (d x \cos \left (d x + c\right )^{4} + 2 \, d x \cos \left (d x + c\right )^{3} - 2 \, d x \cos \left (d x + c\right ) - d x\right )} \sin \left (d x + c\right ) + 87 \, \cos \left (d x + c\right ) + 96}{105 \, {\left (a^{2} d \cos \left (d x + c\right )^{4} + 2 \, a^{2} d \cos \left (d x + c\right )^{3} - 2 \, a^{2} d \cos \left (d x + c\right ) - a^{2} d\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cot ^{4}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 114, normalized size = 0.82 \begin {gather*} \frac {\frac {3360 \, {\left (d x + c\right )}}{a^{2}} + \frac {35 \, {\left (21 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}} + \frac {15 \, a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 147 \, a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 770 \, a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4410 \, a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{14}}}{3360 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.65, size = 182, normalized size = 1.31 \begin {gather*} \frac {15\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-35\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-147\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+770\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-4410\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+735\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+3360\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (c+d\,x\right )}{3360\,a^2\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________